package br.com.io.streams;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class LerArquivo2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			FileInputStream fis = new FileInputStream(new File("arquivo.txt"));
			BufferedInputStream bis = new BufferedInputStream(fis);
			StringBuilder sb = new StringBuilder();
			int b = 0;
			while((b=bis.read())!=-1){
				sb.append(((char)b));
			}
			System.out.println(sb);
			bis.close();
			fis.close();
		
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		catch(IOException e){
			e.printStackTrace();
		}
//		ByteArrayInputStream bais = new ByteArrayInputStream(//fis.)

	}

}
